Imports Castle.ActiveRecord


''' <summary>
'''	Gerado por MyGeneration usando o template ActiveRecord Object Mapper-1.0.3
'''	Criado em 14/08/2010 00:29:39
''' </summary>
''' <remarks></remarks>

<Serializable(), ActiveRecord("perfil", DynamicUpdate:= true)> _
Public Class Perfil
    Inherits ActiveRecordBase
	
	Private _cd_perfil As Integer
	Private _perfil_descricao As String


    Private _Pessoas As IList = New ArrayList
    Private _Permissaos As IList = New ArrayList


	<PrimaryKey(PrimaryKeyType.Sequence, SequenceName:="perfil_cd_perfil_seq")> _
	Public Property cd_perfil() As Integer
		Get
			Return _cd_perfil
		End Get
		Set(ByVal value As Integer)
			_cd_perfil = value
		End Set
	End Property

	<[Property]("perfil_descricao")> _
	Public Property perfil_descricao() As String
		Get
			Return _perfil_descricao
		End Get
		Set(ByVal value As String)
			_perfil_descricao = value
		End Set
	End Property

    <HasMany(GetType(Model.Pessoa), Table:="pessoa", ColumnKey:="cd_perfil", Inverse:=True)> _
    Public Property Pessoa() As IList
        Get
            Return _Pessoas
        End Get
        Set(ByVal value As IList)
            _Pessoas = value
        End Set
    End Property

    <HasAndBelongsToMany(GetType(Permissao), Table:="perfilpermissao", ColumnKey:="cd_perfil", ColumnRef:="cd_permissao")> _
    Public Property Permissao() As IList
        Get
            Return _Permissaos
        End Get
        Set(ByVal value As IList)
            _Permissaos = value
        End Set
    End Property
End Class
